package com.leo.blog.login.config;



import lombok.extern.slf4j.Slf4j;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/6/11 15:13
 * @since JDK 1.8
 */
@Slf4j
public class JWTAuthenticationTokenFilter extends BasicAuthenticationFilter {



    public JWTAuthenticationTokenFilter(AuthenticationManager authenticationManager) {
        super(authenticationManager);
    }

    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
        // 获取请求头中JWT的Token
        JWTCommonHanddler.jwtTokenHanddler(request,response,filterChain);
    }


}
